package org.xshop.web;

import java.util.Map;

import javax.servlet.http.HttpServletRequest;

import org.springframework.http.MediaType;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.util.Assert;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.xshop.model.TAppVersion;
import org.xshop.service.IAppVersionService;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import top.ibase4j.core.base.AppBaseController;
import top.ibase4j.core.util.WebUtil;

/**
 * <p>
 * 客户端版本管理  前端控制器
 * </p>
 *
 * @author ShenHuaJie
 * @since 2017-11-13
 */
@Controller
@RequestMapping("app/appVersion")
@Api(value = "客户端版本管理接口", description = "客户端版本管理接口")
public class TAppVersionController extends AppBaseController<TAppVersion, IAppVersionService> {
    @RequestMapping(value = "get.api", method = {RequestMethod.POST, RequestMethod.GET})
    @ApiOperation(value = "查询客户端版本管理", produces = MediaType.APPLICATION_JSON_VALUE)
    public Object query(HttpServletRequest request, String platform) {
        Map<String, Object> param = WebUtil.getParameter(request);
        Assert.notNull(param.get("platform"), "平台类型不能为空");
        param.put("pageSize", "1");
        ModelMap modelMap = new ModelMap();
        return super.query(modelMap, param);
    }
}
